package com.taoye.thread;

public class Demo13 {
	public static void main(String[] args) throws InterruptedException {
		Demo13Thread t = new Demo13Thread();
		t.start();
		System.out.println("暂停前time:+"+System.currentTimeMillis()+";num:"+t.getNum());
		t.suspend();
		Thread.sleep(100);
		System.out.println("暂停后1time:+"+System.currentTimeMillis()+";num:"+t.getNum());
		Thread.sleep(100);
		System.out.println("暂停后2time:+"+System.currentTimeMillis()+";num:"+t.getNum());
		t.resume();
		Thread.sleep(100);
		System.out.println("恢复后time:+"+System.currentTimeMillis()+";num:"+t.getNum());
	}
}

class Demo13Thread extends Thread {
	private long num = 0;
	
	public long getNum() {
		return num;
	}

	@Override
	public void run() {
		while(true) {
			num++;
		}
	}
}